﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace DynamicUIFramework
{
    /// <summary>
    /// NameDialog.xaml 的交互逻辑
    /// </summary>
    public partial class NameDialog : Window
    {
        public NameDialog()
        {
            InitializeComponent();
            this.txtName.Text = this.TargetName;
            this.txtTitle.Text = this.TargetTitle;
        }

        public string TargetName { get; set; }

        public string TargetTitle { get; set; }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {

            this.TargetName = this.txtName.Text.Trim();
            this.TargetTitle = this.txtTitle.Text.Trim();
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }
    }
}
